/**
 * Copyright 2010 Pavel Daniel Alexandru PFA
 * 
 * Licensed under the terms of the GNU Lesser General Public License version 3 
 * as published by the Free Software Foundation. You may obtain a copy of the
 * License at: http://www.gnu.org/copyleft/lesser.html
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations 
 * under the License. 
 */
package com.kobol.webclient.client.signin.view;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
import com.gwtplatform.mvp.client.EventBus;
import com.gwtplatform.mvp.client.PopupViewImpl;
import com.kobol.webclient.client.signin.presenter.ErrorDialogPresenterWidget.MyView;

/**
 * @author Pavel Alexandru
 * 
 */
public class ErrorDialogPopupView extends PopupViewImpl implements MyView {

    interface ErrorDialogPopupViewUiBinder extends UiBinder<PopupPanel, ErrorDialogPopupView> {
    }

    private static ErrorDialogPopupViewUiBinder uiBinder = GWT.create(ErrorDialogPopupViewUiBinder.class);

    @UiField
    Button okButton;

    private final PopupPanel widget;

    @Inject
    public ErrorDialogPopupView(EventBus eventBus) {
	super(eventBus);
	widget = uiBinder.createAndBindUi(this);
    }

    @Override
    public Widget asWidget() {
	return widget;
    }

    @UiHandler("okButton")
    void okButtonClicked(ClickEvent event) {
	widget.hide();
    }
}
